import java.sql.SQLException;

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.ResultSet;
import com.mysql.jdbc.Statement;

	public class ThreadInsert extends Thread{
		String query="";
		Connection con=null;
		  public ThreadInsert(String str, Connection c) {
		        super();
		        query=str;
		        con=c;
		    }
		  public void run() {
			  	Statement s;
				ResultSet rs=null;
				try {
					s = (Statement) con.createStatement();
					int i = s.executeUpdate (query);
					if(i<1) System.out.println(query);
					s.close();
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} 
		   }
		  
	}